Skip to content

[MBL-19958][Student] Migrate dashboard course widget to GraphQL#3648

Merged
hermannakos merged 8 commits intomasterfrom
MBL-19958-dashboard-widget-graphql
Apr 22, 2026
Merged

[MBL-19958][Student] Migrate dashboard course widget to GraphQL#3648
hermannakos merged 8 commits intomasterfrom
MBL-19958-dashboard-widget-graphql

Conversation

@hermannakos
Copy link
Copy Markdown
Collaborator

@hermannakos hermannakos commented Apr 16, 2026

Test plan

  1. Open Student app, navigate to new Dashboard
  2. Verify courses load with correct names, images, colors, and grades
  3. Verify unread announcement badges appear on course cards
  4. Tap an announcement badge — verify navigation to announcement or announcement list
  5. Favorite/unfavorite a course, verify dashboard updates
  6. Force-refresh (pull to refresh) and verify data reloads
  7. Edit a course (change name/color), return to dashboard — verify single-course reload works
  8. Measure load time — target is under 2 seconds (was N+2 sequential REST calls, now 1 GraphQL query)

refs: MBL-19958

affects: Student

Release note

Improved dashboard course widget loading performance by migrating to GraphQL, reducing multiple sequential network requests to a single query.

Checklist

  • Follow-up e2e test ticket created or not needed
  • Tested in dark mode
  • Tested in light mode
  • Test in landscape mode and/or tablet
  • A11y checked
  • Approve from product

hermannakos and others added 2 commits April 16, 2026 11:22
Replace N+2 sequential REST API calls with a single GraphQL query for
the dashboard courses widget. Previously, loading the widget required
fetching all courses, dashboard cards, and then announcements for each
visible course individually. Now a single DashboardCoursesQuery fetches
courses, dashboard card info, enrollments, and announcements in one
round-trip with depagination support.

Also fixes pre-existing nullability issues in SubmissionRubricManagerImpl,
SubmissionContentManagerImpl, and SubmissionGradeManagerImpl caused by
the schema update.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1210 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 790 total, 0 failed, 0 skipped
  • Duration: 37.320s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 3418 total, 0 failed, 0 skipped
  • Duration: 64.855s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 5418
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Tue, 21 Apr 2026 13:58:31 GMT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

📊 Code Coverage Report

✅ Student

  • PR Coverage: 42.61%
  • Master Coverage: 42.61%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 25.31%
  • Master Coverage: 25.31%
  • Delta: +0.00%

✅ Pandautils

  • PR Coverage: 23.99%
  • Master Coverage: 23.88%
  • Delta: +0.11%

📈 Overall Average

  • PR Coverage: 30.63%
  • Master Coverage: 30.60%
  • Delta: +0.04%

@tamaskozmer tamaskozmer self-requested a review April 16, 2026 14:00
Tests that uninstall GraphQlApiModule need a fake binding for
the new DashboardCoursesManager interface.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Student Install Page

@kdeakinstructure kdeakinstructure self-requested a review April 17, 2026 07:38
Copy link
Copy Markdown
Contributor

@tamaskozmer tamaskozmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA:

  • I noticed that for my user I see different courses than on master. For one of my courses the announcement count is also different. We should check that as well.

Copy link
Copy Markdown
Contributor

@kdeakinstructure kdeakinstructure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This issue might not related directly to the PR but I'm highlighting it since it can be reproduced clearly so we should fix it, whether here or in a separate ticket. The issue is that giving a nickname to the course and tapping on 'Done' button (to save it) won't be applied ever.
Screen_recording_20260417_104201.mp4
  • By measuring loading time, with 8-9 courses it's kind of a 4ish (so double than the target 2). However, far more better than it was before. So I think we could 'live with this', but since there was an exact target number I was picked this up as an issue.

@tamaskozmer
Copy link
Copy Markdown
Contributor

  • This issue might not related directly to the PR but I'm highlighting it since it can be reproduced clearly so we should fix it, whether here or in a separate ticket. The issue is that giving a nickname to the course and tapping on 'Done' button (to save it) won't be applied ever.

Screen_recording_20260417_104201.mp4

  • By measuring loading time, with 8-9 courses it's kind of a 4ish (so double than the target 2). However, far more better than it was before. So I think we could 'live with this', but since there was an exact target number I was picked this up as an issue.

I think we might improve it more with my suggestions. After implementing it please test again with your user.

hermannakos and others added 3 commits April 20, 2026 15:00
- Add explicit page size (first: 20) for announcement queries
- Fix visible courses filter: use dashboardCard presence instead of
  isFavorite to match the old DashboardCards behavior
- Drop announcements from DashboardSingleCourseQuery since reloadCourse
  is called from course customization where announcements don't change
- Create separate CourseAnnouncementsQuery for per-course announcement
  depagination instead of re-fetching all courses on each page
- Simplify DashboardCoursesQuery to a single non-paginated request,
  with per-course depagination handled by getCourseAnnouncements()
- Update tests for all changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@tamaskozmer tamaskozmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA:

  • I think we are not considering announcement replies in the unread count. Test it with Kristóf's student user. I can see only 3 unread announcements for CourseOne, while it's actually 12 on master, and you can see that it is 12 also when you open the announcement list.

hermannakos and others added 2 commits April 21, 2026 15:24
- Use GRAPHQL_PAGE_SIZE parameter instead of hardcoded page size
- Pass endCursor from initial query to getCourseAnnouncements to avoid
  fetching the first page twice during depagination
- Restore LoadDashboardCardsUseCase composition in LoadVisibleCoursesUseCase
  so dashboard card visibility and ordering are correct
- Apply course nickname from DashboardCard.shortName during reload
- Add test for nickname reload behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show the announcement badge when either the announcement header itself
is unread or it has unread entries (replies). Add entryCounts to both
GraphQL queries and update filtering logic accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hermannakos hermannakos requested a review from tamaskozmer April 21, 2026 13:43
Copy link
Copy Markdown
Contributor

@kdeakinstructure kdeakinstructure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA 👍

@hermannakos hermannakos merged commit 597f1c0 into master Apr 22, 2026
47 of 50 checks passed
@hermannakos hermannakos deleted the MBL-19958-dashboard-widget-graphql branch April 22, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants